<?php
namespace Admin\Controller;

class OrdersController extends CommonController {
    public function index(){
        $list = M()->table('dota2_orders')->select();
        $this->assign('list',$list);
        $this->display();
    }

    public function detail(){
        $oid = I('get.oid');
        $data = M()->table('dota2_o_detail')->join('dota2_goods')->where('o_d_oid = "'.$oid.'" and o_d_gid = g_id')->select();
        $this->assign('data',$data);
        $sum = 0;
        foreach($data as $v){
            $sum += $v['price']*$v['o_d_num'];
        }
        $this->assign('sum',$sum);
        $this->display();
    }
}